/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-03-23
 * Time: 14:40
 */
public class test2 {
    /**
     * LeetCode 283
     */

    public void moveZeroes(int[] nums) {
        int slow = 0;
        int n =nums.length;
        int fast = 0;
        while(fast<n){
            if(nums[fast]!=0){
                swap(nums,slow,fast);
                slow++;
            }
            fast++;
        }
    }

    public void swap(int[] nums,int slow ,int fast){
        int tmp  = nums[slow];
        nums[slow] = nums[fast];
        nums[fast] = tmp;
    }
}
